import request from './request';
/**
 * @returns 登录接口
 */
export const Login = (data) => request({
    url: `/login`,
    method: "post",
    params: data
})
/**
 * @returns 左侧导航接口
 */
export const Menu = (data) => request({
    url: `/menus`,
    method: "get",
    params: data
})
/**
 * 
 * @returns 获取用户列表
 */
export const getUserlist = (data) => request({
    url: `/users`,
    method: "get",
    params: data
})
/**
 * @returns 搜索接口
 */
export const Searchs = (data) => request({
    url: `/users`,
    method: "get",
    params: data
})
/**
 * @returns 添加接口
 */
export const adds = (data) => request({
    url: `/users`,
    method: "post",
    data
})
/**
 * @returns 修改回填接口
 */
export const edit = (id) => request({
    url: `/users/${id}`,
    method: "get"
})
/**
 * @returns 修改接口
 */
export const edits = (id,data) => request({
    url: `/users/${id}`,
    method: "put",
    data
})
/**
 * @returns 修改状态接口
 */
export const editstatus = (data) => request({
    url: `/users/${data.id}/state/${data.mg_state}`,
    method: "put",
})
/**
 * @returns 删除接口
 */
export const del = (id) => request({
    url: `/users/${id}`,
    method: "delete",
})

//角色列表
export const getRoles = (params) => request({
    url: "roles",
    method: "get",
    params: params
})
//添加角色
export const addRoles = (params) => request({
    url: "roles",
    method: "post",
    data: params
})
//修改角色
export const editRoles = (params) => request({
    url: `roles/${params.id}`,
    method: "put",
    data: params
})
//删除角色
export const delRoles = (id) => request({
    url: `roles/${id}`,
    method: "delete",

})
//权限列表
export const getRolesList = (params) => request({
    url: "rights/tree",
    method: "get",

})
//权限列表
export const getRolesLi = () => request({
    url: "rights/list",
    method: "get",

})
